<?php

	namespace Vavilen\FirstBundle\Entity;

	use FOS\UserBundle\Entity\User as BaseUser;
	use Doctrine\ORM\Mapping as ORM;
	use Doctrine\Common\Collections\ArrayCollection;

	/**
	 * @ORM\Entity(repositoryClass="Vavilen\FirstBundle\Entity\Repository\UserRepository")
	 * @ORM\Entity
	 * @ORM\Table(name="fos_user")
	 */
	class User extends BaseUser
	{
		/**
		 * @ORM\Id
		 * @ORM\Column(type="integer")
		 * @ORM\GeneratedValue(strategy="AUTO")
		 */
		protected $id;

		/**
		 * @ORM\OneToMany(targetEntity="Post", mappedBy="fos_user")
		 */
		protected $posts;

		public function __construct()
		{
			parent::__construct();
			// your own logic
		}
	
    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Add posts
     *
     * @param \Vavilen\FirstBundle\Entity\Post $posts
     * @return User
     */
    public function addPost(\Vavilen\FirstBundle\Entity\Post $posts)
    {
        $this->posts[] = $posts;
    
        return $this;
    }

    /**
     * Remove posts
     *
     * @param \Vavilen\FirstBundle\Entity\Post $posts
     */
    public function removePost(\Vavilen\FirstBundle\Entity\Post $posts)
    {
        $this->posts->removeElement($posts);
    }

    /**
     * Get posts
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getPosts()
    {
        return $this->posts;
    }
}